﻿using LPLS.Commons.DBModule;
using MiniExcelLibs.Attributes;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LPLS.DBEntities.ConfigModels.AlarmModels
{

    /// <summary>
    /// 报警变量表
    /// </summary>
    [DatabaseKey(DatabaseEnum.SqliteConfig)]
    [SugarTable("AlarmVarableConfig")]
    public  class AlarmVarableConfig
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int  Id { get; set; }
        /// <summary>
        /// 变量名称
        /// </summary>
        [SugarColumn(Length = 100, IsNullable = false)]
        public string VarName { get; set; }

        [SugarColumn(Length = 100, IsNullable = true)]
        public string Desc { get; set;  }

        [ExcelColumnName("索引")]
        [SugarColumn(IsIgnore = true)]
        public string Index { get; set; }
        [ExcelColumnName("报警代码")]
        [SugarColumn(IsIgnore = true)]
        public string AlarmCode { get; set; }
        [SugarColumn(IsIgnore = true)]
        [ExcelColumnName("报警")]
        public string AlarmMessage { get; set; }
        [SugarColumn(IsIgnore = true)]

        [ExcelColumnName("等级")]
        public string Leve { get; set; }
        [SugarColumn(IsIgnore = true)]
        [ExcelColumnName("启用")]

        public string IsActive { get; set; }
        [SugarColumn(IsIgnore = true)]
        [ExcelColumnName("解决方案")]
        public string SoulMessage { get; set; }
















        /// <summary>
        /// 改变量对应的变量Code集合  导航 一对多
        /// </summary>
        [Navigate(NavigateType.OneToMany, nameof(AlarmVarableCodeConfig.AlarmVarableID))]
        public List<AlarmVarableCodeConfig> AlarmVarableCodeConfigs { get; set; }=new List<AlarmVarableCodeConfig> ();

    }
}
